//
//  FrameDefine.h
//  rxtd_bdd
//
//  Created by 陈利群 on 15/4/11.
//  Copyright (c) 2015年 陈利群. All rights reserved.
//

#ifndef rxtd_bdd_FrameDefine_h
#define rxtd_bdd_FrameDefine_h

#define k_frame_base_width [[UIScreen mainScreen]bounds].size.width
#define k_frame_base_height [[UIScreen mainScreen]bounds].size.height
#define ScreenWidth [[UIScreen mainScreen]bounds].size.width
#define ScreenHeight [[UIScreen mainScreen]bounds].size.height
#define  CurrentWidth	414.0
#define  ScaleRate (ScreenWidth/CurrentWidth)	//适配缩放比例
//获得屏幕的宽高
//iPhoneX / iPhoneXS
#define isIphoneX_XS (ScreenWidth == 375.f && ScreenHeight == 812.f ? YES : NO)
//iPhoneXR / iPhoneXSMax
#define isIphoneXR_XSMax (ScreenWidth == 414.f && ScreenHeight == 896.f ? YES : NO)
//异性全面屏
#define isFullScreen (isIphoneX_XS || isIphoneXR_XSMax)
//#define isFullScreen (ScreenHeight >= 812.f ? YES : NO)
// Status bar height.
#define XStatusBarHeight (isFullScreen ? 44.f : 20.f)
// Navigation bar height.
#define NavigationBarHeight 44.f
// Tabbar height.
#define XTabbarHeight (isFullScreen ? (49.f+34.f) : 49.f)
// Tabbar safe bottom margin.
#define XIndicator (isFullScreen ? 34.f : 0.f)
// Status bar & navigation bar height.
#define XTop (isFullScreen ? 88.f : 64.f)

#define lengthRate(x) x*ScaleRate
static const float RealSrceenHight =  667.0;
static const float RealSrceenWidth =  375.0;

#define AdaptationH(x) x/2/RealSrceenHight*[[UIScreen mainScreen]bounds].size.height
#define AdaptationW(x) x/2/RealSrceenWidth*[[UIScreen mainScreen]bounds].size.width
#define  ScaleRate1 (ScreenWidth/CurrentWidth/2)	//适配缩放比例
#define LeftBoarder (20*ScaleRate/2)
#define HeightBoarder LeftBoarder/2
#define k_frame_head_height 20
#define k_frame_navigation_bar_height 44
#define k_frame_tabbar_height 49

#ifndef iPhone5
#define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
#endif

#ifndef iPhone4
#define iPhone4 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size) : NO)
#endif

//textField字体大小13
#define k_font_textField_size_13 13
#define k_font_textField_size_16 16

//button字体大小13
#define k_font_button_size_13 13

//button字体大小13
#define k_font_button_size_14 14

//button字体大小11
#define k_font_button_size_11 11
//button字体大小16
#define k_font_button_size_16 16
//button color
#define k_font_button_color 0x009cbe

//label字体大小11
#define k_font_label_size_11 11
//label字体大小12
#define k_font_label_size_12 12
//label字体大小13
#define k_font_label_size_13 13
//label字体大小14
#define k_font_label_size_14 14
#define k_font_label_size_16 16
//label字体大小18
#define k_font_label_size_18 18

//label字体大小26
#define k_font_label_size_26 26

//除去底部tablview和导航栏的高度
#define k_frame_with_out_bar_tabbar_head  k_frame_base_height - k_frame_tabbar_height - k_frame_head_height- k_frame_navigation_bar_height

//使用Masonry用
#define WS(weakSelf)  __weak __typeof(&*self)weakSelf = self;

#endif
